fixed bugs + writing passwords to file

now passwords are stored in password.txt file