made functions use passwords correctly