more general compareTo