Add tests. Update paginator code to accomidate testing.