Pagination works! Much refactoring still needed