changed file iterator function to not yeild