moved game logic to object