use 'with' context manager with file (much better than try...finally)