Automatic frequency-based rules generation randomized and optimized and working.