added UpdatePatternByInput()