added pagination and other stuff