add histogram functionality