Functions added: plotDensities and plotHist