insert routine for tree