added sort and filter functionality