modified code for signature verification.