Use array_walk instead of array_reduce