added traversals in less code