diced: restyle summation code
update code style, add comments
provide example