minor improvements: hierarchical rules still need some fixing