fixed bugs in walking logic that skipped parts of tree