recursive comparison tool