starting work on pattern matching