start of pattern edit