Main game loop implemented