adds functionality to parse cardinality along with tests refs #123