added function to draw line plot