1. Fixed behaviour on resizing 2. Developing logic for running code

Authored by siddhism.