Corrected Functions and added cardinality() for everyone