I made a memory class which runs through a given number of moves and finds the best one.