add paging, needs refactoring & fix performance issues