Consensus and Profile (clean up)

Cleaned up code writing to the output file.