added paging support

This branch fixes #11.