started on pattern matching