Deleted dead code
Close an fstream when done
Added a basic tracing utility