changed histogram calculation

optimized version of hue/saturation histogram generation