added rule switching