added histogram functions