replacing lib/compare promise with callback