Add root node setting and calculation