typos
compare function refactored (checks formal equality with no impelemntation-relations)