Altered searching function, added basic idea for abstracting and facilitating tree traversal.