added histogram support