sum -> reduce(_ + _) to fix compile error