added a few functions to Sort api