Main game loop written