Course completions

simplified treatment of special cases on an associative array.

sorry for the last PR that was not complet.

Thanks,

Jordi