Finish generate parentheses
solving sums