Changed parameter name "keys" to "key" in `reduce` function