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