trying to fix tree joint indexing