made Proper Comparator for the Range