added source of sum reduction code