updated to use generateMoves