updated the signature decoding algorithm