Code creating figure 2 and 3 in the writeup