the comparison function is garanteed to return an int