final version of patterns