Working code! Building atomatic patch rule.