fix bug in setting the sum weights
fix bug in a non str-->int implicit conversion
percolate properly the inputs
fill the proper tree