This may not have a quick solution? But still please give me some pointers. I don't understand why after the 4th cycle the window gets repainted.

Help...