Added legend, axes, title for the plot, Changed rand