updating game loop code for fixed framerate, not sure if it builds or works as expected yet