beginning of compare()