added rudimentary pagination