implented methods and unit test for haveValidMove and isGameOver