 
 do {
     let input = "cqjxjnds"
-    try print(nextValidPassword(input))
+    
+    let nextValidPass1 = try nextValidPassword(input)
+    print("Part 1: " + nextValidPass1)
+    
+    let nextValidPass2 = try nextValidPassword(nextValidPass1)
+    print("Part 2: " + nextValidPass2)
 }
 catch AdventError.WrongChar {
     print("Password had invalid character")
-}
+}
}

func nextValidPassword(oldPass: String) throws -> String {
    var curPass = oldPass
    var found = false
    
    while found == false {

        if !has3Straight {
            if curChar == "a" {
                straightCount = 1
            }
            else {
                guard let curCharIndex = alphabet.indexOf(curChar), let prevCharIndex = alphabet.indexOf((prevChar)) else {
                    throw AdventError.WrongChar
                }
                
                if curCharIndex == prevCharIndex.successor() {
                    straightCount = straightCount + 1
                    if straightCount == 3 {
                        has3Straight = true
                    }
                }
                else {
                    straightCount = 1
                }
            }
        }
        
