completed group item encoding/decoding

not tested.