decrypt function now works