Attempted pgdir_walk function