adding pagination function fixes #11