Added some logic to the game