refactor a bit, change Chord to Chinv to give right inversions knowing melody