added encryption as an option
corrected changes to allow compile