Updates to comparator, should fix bugs