Lab 8 added dispatch rule with foreach