Code creating figure 8 in the writeup