Added count of key comparisons to sorting routine