rough attempt at pagination