The chords and some pseudocode