scan with varying size window in detection and preparation