create comparator functions for sorting an array