rewrite init_paging