creation of the def compare