Writing a better Signing Function