Added code to generate plots