Optimizing the Output figure 3