speed improved, name and password are read from a file