Instead of iterating over all the inputs and outputs to calculate the totals we should be able to access it via an opcode instead