Zoom works, but not quite well

Really did not want to post yet another topic about zoom, but I am stuck with some minor problem.

I have implemented zooming like this:

    
    f->glTranslated(xPosition, yPosition, 0);
    f->glScaled(Zoom, Zoom, Zoom);
    f->glTranslated(-xPosition, -yPosition, 0);

All is good when I zoom in and out on one point, however, when I move mouse to zoom other point, the whole canvas is suddenly getting moved to another position. This happens on large zoom only. I wanted to correct xPosition and yPosition every time I change position, but that did not really work. As I understand this is the problem with glTranslated, but what I am missing and how do I fix this issue?

Thanks in advance.

I realized that I was working with outdated OpenGL version, so this question is not relevant anymore. This topic can be closed.