Code to make a smaller forest from a larger one