I have tried drawing less number of rectangles,
What jacek pointed out is still true.
The problem is not the number of rectangles, but the value of Y1!