Fixed the password generation function so that it uses unique grid numbers and generates an accurate password.