plotting output optimized