continuing comments; changed way the encryptdata function checks if it failed