diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -28,7 +28,7 @@
         result = self.calculateNiceDivisors(base, power // 2, MOD)
         result = (result * result) % MOD
 
-        if power % modulo == 1:
+        if power % 2 == 1:
             result = (result * base) % MOD
 
-        return result
+        return result