changes to Solver: made the max moves more flexible