wrote MDM homework3