Pattern matching nested tuples

Nice, I will have to digest this a bit. It is very clean, but also somewhat verbose from my perspective. More of an engineering solution. Thanks!