added code for scatterplots