added an optimization for sided rules