Refactoring to better reflect the comparator's function
All tests finally pass
ignore tmp files