added flags to scan for cutoff index