another try at the pagination problem