Adding compare function