Implemented pagination, minor changes