Started tidying up loadFile() rubbish calls and such, but gave up.