refactored d-value and polemy-value conversion