Added the implementation of the posterior decoding algorithm