added a minMoves variable