working on C q_digest