Implemented dynamic sorting by multiple fields