add scoring feature and newGame() function