added triemap implementation