the algorithm in a way I believe Jim suggested a few weeks ago (but that I didn't understand then).
Attach a file by drag & drop or click to upload