adding and editing rules