Added semi fixed step timing. Added window close event handler