Moved game loop here