added histogram plot code