debugging initial pattern detection