Code creating figure 1 in the writeup