added pagination stuff