Refresh compare function