Add code to produce reduced trees (untested).