Ok...So I wrote a new chaincode function and it's worse than the original...