Added code to write the passwords to the text file character by character