some minor changes to traversal. It does not work completely yet