0364: reworked course merging
* shortened loops by ca. 80%
* use closest match instead of first match