moved game logic to new file