Using Tuples and pattern matching