finalized version 2 of the directives system, now exponentially faster