added plaintext extraction