Rewriting to generics.
Updated structure binary tree.