Pseudocode for cardstack