updated code for signature comparison