encoding and decoding scripts ready for review