handle tuples nested inside arrays too.