Homework6: making a tree datatype with corresponding functions