SCORU origination function is hard to read
The current implementation is 70 lines long and quite unstructured: for instance, it is not obvious to relate the computed cost of storage to the actual storage processing.
I propose to decompose this function into smaller functions.