added fn apply-pagination to clojure