new pattern code