updated timer and added max FPS limit