Moved forest generation to it's own function