added discussion about why the naive approach used reduce instead of summing inside the loop