Changed calculation of DOS.