finish functional tree