Added the actual logic for the game