added histogram, new deviates management for multithreading