I made the input method better. Basically, now it will calculate the encrypted method every key press, but then we can’t necessarily keep up, lets say user copy pasted a message or maybe is just typing fast(bc we use animation) we won’t encrypt everything. So my first idea was to encrypt everything in the input box every time we press new key, but that doesn’t work becaus then it say the user puts in the alphabet, we will consider the message aababcabcd which is wrong. So then i thot, lets keep a track of what is the longest message that we know they have entered and only calculating the new part. Once enter is pressed, clear out plaintext. However, that doesn’t work because there are conflicting accounts of “latest calculated string” so it fails on fast type. I think the problem there was something to do with requests being handled on sepereate threads. What i finally did, is for once in my life found a practical implementation of datastructures. I implemented a queue directly into the plaintext and a flag to see is stuff being handled rn. If yes, you don’t do anything because your character wiill eventually get processed as part of the queue. If no, then start the queue, and if new characters are typed they will be added too.