changed getPattern return type