minimalized the compare function