added histogram and other changes