Implement the walk function