second example of reduce() used to sum by orders