functional hierarchical tree code