Updated chartbeat code.