moved patternmodel.cpp into patternmodel.h