The code looks o.k. to me.

So it's time to start your debugger and to check the number of points.

Uwe