'with' statement for safer file I/O