adding caridinality cases to template