add new tests, more pattern matching