Added comparator and sorter classes.