updated the code for analyzing forest