more work in getting decryption working (still not complete)