improved sort

added functionality to sort based on user groups and channels; fixed
duplicity issue