Updated getPattern, still not tested