Modifications to allow for traversal algorithms. Currently it runs with a depth traversal algorithm.