Use one loop to find all desired attributes
Implemented file names?

I see no reason this shouldn't work but it doesn't...