modifying for encryption