Mia's figure 3 code