My version of Array reduce