Add #compare function.