Without tests we cannot say for sure that inject is executing the operation on the elements of the array in the proper order.