Added nested tuples
Added nested tuples in scale_sum