added paging and sorting functionality to table