             throw ShortenerError.InvalidAlphabetCharacter
         }
     }
+
+    static func checksumForSeq(_ seq: Int64) -> String {
+        let checksumGenerator = seq % (Int64(alphabet.count) ^ 2)
+        let backwards = backwardsIntToAlphabet(int: checksumGenerator, alphabet: alphabet, acc: [])
+
+        if (backwards.count == 2) {
+            return String(backwards.reversed())
+        }
+        else {
+            return String([alphabet[0], backwards[0]])
+        }
+    }
 }


    static func seqForSlug(_ slug: String) throws -> Int64 {
        let slugChars = Array(slug.characters)
        let intValue = try slugChars.map({ letter in
            return try Shortener.intFromAlphabetLetter(letter)
        }).reduce(Int64(0), combine: +)
        print("intv: \(intValue)")

        return intValue
    }

    static func intFromAlphabetLetter(_ letter: Character) throws -> Int {

    case FailedURL
    case InvalidId
    case InvalidAlphabetCharacter
    case InvalidChecksum
}

class Shortener {
    static let alphabet: [Character] = Array("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".characters)

    static func generateSlug(fromSeq seq: Int64) throws -> String {
        let alphabetEncoded = intToAlphabet(int: seq, alphabet: alphabet)
        let checksum = checksumForSeq(seq)
        return checksum + alphabetEncoded
    }

    static func urlForSlug(_ slug: String) throws -> NSURL {
