tree working code insert and delete