add try/finally to close down streams/files.