I'm reading Lanczos's The variational principles of mechanics, and on pp. 80-81 there is an example involving a system made up of $n$ rigid bars, freely jointed at their end points, and the two free ends of the chain being suspended.
The coordinates are chosen so that the $x$ axis is horizontal, and the $y$ axis is pointed vertically downwards. If the rectangular coordinates of the end points of the bars are denoted by $(x_k, y_k)$ and the length of the bars is denoted by $l_k$, then the expression for the potential energy will be of the form
$$ \frac{g}{2} \sum_{k=0}^{n-1} (y_k + y_{k+1}) l_k .$$
My problem with this is: the way I've understood things so far, the potential should have a negative sign because going "down", that is, going in the direction of the force of gravity, should decrease the value of the potential function. But in this example, the opposite appears to be true: going down increases the value of the potential. What am I getting wrong here?