Added debug mode, tracks history of moves