changes to encrypt and main