Loop & bg problem

and for the problem that it continues to draw random polygons? any idea? thanks in advance