now generating rules