Added functions to perform sigma clipping and plot histograms.