Implemented slicing and sorting of results of $() function.