added 'pattern.cpp', more subdivision of source