Updated canonical pattern code
fixing merge