fleshing out the decoding, not quite done