Implement basic logic of the game