Added code to generate figure 12