comapre and comparator