rewrite order statistic filter and pagination