Modified for sorting by set param