update the histrogram