comparator for Ray