worked on creating tree and then processing it for traversal.