used pattern matching on region code