added sorting and filtering