BT: generating sum tree