finished decryption logic and removed unused code and some comments