Add explodeTree function