implemented delete-rule function