compare function and limits