Fixing the horrible diatonic chord method I implemented earlier.