changed pagination to use a case class rather than send a whole bunch of parameters to the view