Refactored numberOfMoves