Implementing mctree by David C. --kazu