first pattern matching attempt