code to do figure 8