Functionality to sort items on a page