Encoding and decoding. Not worked yet.