Updated encoder/decoder