further work on pagination, still in progress