now use modulo appropriately
Several subs to work on chords