allow user-defined comparison function
v1.0.2