Remove unnecessary to_a and simplify multiple
summation in more canonical ruby form.