Recoded Game loop for more stable FPS