did some work towards completing pagination, will be easier once the abstraction is complete