changed return type to dict, changed max_page_num to array