add minitree to algorithm