Modified Tree class to accept generics instead of just int's.