         enterDelete()
         nextWord = getAutoCompleteWord()
         if (curWord != "") {
-        for _ in 0...curWord.characters.count-1 {
+        for _ in 0...curWord.characters.count - 1 {
             (textDocumentProxy as UIKeyInput).deleteBackward()
         }
         (textDocumentProxy as UIKeyInput).insertText(curWord)

    
    func getAutoCompleteWord() -> String {
        var searchTerm = curWord + keyboardRows[selectedRowIndex][selectedCharIndex]
        for i in dictStart...(dictionary.count-1) {
            if (dictionary[i].characters.count >= searchTerm.characters.count) {
                if (dictionary[i].hasPrefix(searchTerm.lowercased())) {
                    return dictionary[i]

    }

    func getPositionInDictionary() -> Int {
        for i in dictStart...(dictionary.count - 1) {
            if (dictionary[i].characters.count > curWord.characters.count) {
                if (dictionary[i].hasPrefix(curWord.lowercased())) {
                    return i
