Refactored parcePatterns() method. Fixed bugs. Test added.
Removed random file