added VectorToHist function