working on tree insert logic