changed logic of MD