cleaning up decoding in 2/3 way