Improved the decoding process