add level walk proc

but the code is not very pretty.