The main code for game