Use bracket to ensure files are closed.