using with statement to handle files