added comments and improved startGame wait loop