Improved MovingPolygon code