the decoder now works for all iterations