Added code for generating figures