added more comments, and added in a check to decrypt for key creation errors