fixed indentation of conditional in for loop in cardinality()