Adds comparator to heap sort