diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -11,7 +11,7 @@
     def findPeakElement(self, nums: List[int]) -> int:
         n = len(nums)
         low = 0
-        high = n
+        high = n - 1
         if n == 1:
             return 0
 
@@ -22,7 +22,7 @@
             ):
                 return mid
             elif nums[mid] <= nums[mid + 1]:
-                high = mid + 1
+                low = mid + 1
             else:
-                low = mid - 1
+                high = mid - 1
         return -1
