Added experimental code
Rewrote generic rule for directories