trees and monoids