added pagination and other things