doing some stuff on pattern matching