added computation of scan using chunks