added mc function