Added the code to handle smooth framerate animation and updated keypress.