added filter/sorting with memory