`opcode` is not `o[0]`. Only on first iteration.
And rather than counting the bytes myself to get to the `idx` byte to see the opcode, I found the information of opcode ahead helped quite a bit; as you can verify your counting then as well, when you counted for context in the byte list.