updated the cmi and mi measuring scripts for efficiency