can take an array of trees as input for the cache section.