serial version of histogram