started compare function