addition of modified tree-alignment code.