added comments and debugged...
Debugged encryption and decryption