Added types to the parameters of the comparator function