Histogram function amended and functions renamed.