Hi,
A potentiometer has 3 connections. As the resistance increases between the left and middle connections, it decreases between the middle and right connections. So when you say the resistance is increasing, it depends which direction you are turning it and which of left and right is connected to 5V and 0V. So just swap the 5V and 0V connections to the pot!
Also, when posting code, always use code tags (use the# button). Please edit your original post and fix that.
Paul