added pseudocode decoding algorithm