Added gameloop logic