Add get_primary_pages() function