using reduction over sum
Merge origin/master