could you pls make this a single loop which changes the filenames?