adding code to generate plots