debugged clean-pair.pl