implemented pattern occurrence detection for dynamic goTo.. options