Added framerate regulation