wrote insert() for the tree