Use proper looping logic; add a first run variable; require files for each pass