Code for the full game