Clarified string manipulation in trimFiles

Iteration over list of invited towns now only happens if the previous check for things in that list passes