Working version of signature verification