creating rudimentary pagination