fix the tree and readied the code for integration with ibws