updated sorting by paramentr