finished posterior decoding