changed the md-idc algorithm