Get pages() generator working