changed injects to .reduce