Completed main game coding