merged old changed to support patternfiles
Merge pull request #1 from zen/patternfiles

merged old changed to support patternfiles