Implemented loading of patterns from file, with error checking