Use pattern matching on vectors