Created a compare method