added filter and sorting