optimized the drawing