preparing for passwordIsValid function