Added better sorting and Comparable IntKeyValuePairs