massive update to the MMD part