adding pattern-constructor