complete patterns

complete pattern.h and patterns.cpp