Add histogram function.