Working encoder/decoder
preprocess