CSV trace file now works. Refactored some named tuples.