Added set cardinality function