plantTree and insertB functions have been realized