created codeToSign and signToCode method