cleanup: use "with open()" to open files