bug correction and better framerate