began work on pattern matching