adding dispersion calculation