rechecked the logic of the steps requiring back tracking to see what previous comparisons existed. Seems logically correct now and works on test cases. But more testing required.