added pagination (finally!)