new code for reduced trees production