Improved algorithm. Not tested
Stem rules that stem to null implemented. Single level