changes to sign function