added pagination, and various other features