Worked on game loop