Added decryption and reorganized