Debugged the faulty edge generation in the rule application and commented various things.