fixed write_chords.py to print final chord