diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -20,7 +20,7 @@
             dp[0][i] = i
         for i in range(1, m + 1):
             for j in range(1, n + 1):
-                if word1[i] == word2[j]:
+                if word1[i - 1] == word2[j - 1]:
                     dp[i][j] = dp[i - 1][j - 1]
                 else:
                     dp[i][j] = min(dp[i][j - 1], dp[i - 1][j]) + 1
