Adding decodeScriptOps and encodeScriptOps functions