Adding with statement to files and explanations to funciones2