Optimizing the Output figure 2