accepting a custom isEqual function