changing 'finalResult' to 'trees'