refactoring isValidWord
playGame method passing spec