updated definition and comment for 'sort'