modified calculation of types