working sort, filter and memory