[3] another solution, typed pattern match on tuple