improving histogram method
improving histogram method.
resolved duplicates problem in histogram method