added code to plot
init