encode, decode: implemented; draft