Adding streaming ability to calculate cardinality