Added M7 logic