modified to caluculate.