support sorting by the user provided compartors. fixed #2