Make 'unpack_trees()' take the index to work on as an argument