walk() function passing tests