switched over to the game loop pattern