adding patterns for class