Add file close
use perform instead of unclearly call
Use clearly foreach loop
Use clearly foreach