Changing - remove coeficients array, just use branches array
Final changes - correct output of result