Adding BW-E-KSDC calculation logic

Correct the previous bugs in the calculation of E-KSDC (found by Martin)
and adding the BW-E-KSDC calculation logic