Using md_d instead of recalculating