Tidied a couple of 'for' loops from:
    for t in ...
to:
    for t,pat ...