Add pagination and various other changes