Updating categories method to sort results