BazzaCAD:
It's just the logic with the pot code that I can't figure out.
Initially I assumed that MAX_LEFT was less than MAX_RIGHT, and with that assumption your code seemed to make sense. But in fact MAX_LEFT is greater than MAX_RIGHT. That means that the comparisons you're applying to your pot values are back to front.