implement new walking algorithm