Adding Pattern Matcher

This is the book program and my answers to the exercises from chapter 16