Fix from Sam

- An ofstream is automatically closed when it goes out of scope, as it does at the end of main().
- You can open a file with an explicit constructor
See: RAII.
- Indentation
Merge pull request #1 from Fedjmike/patch-1

Fix from Sam