more code for plotting