Adapted for mad.