Rewrote the traversal functions to be able to utilize a callback function in regards to the node currently being traversed, and removed unnecessary code.