Changed the patterns to two-tuples