Chnaged the implementation of the Heterogeneous tree