added functionality to sort/filter