more decoding steps and a unit test