implemented lazy-paging and some changes