using global variables on RHS and LHS of rule