added simple comparator support for sorting