basic lab03: pattern matching exercise