Modificated to optimize the mSWAP