(1) Fixed errors in new mem comparison. Integrated the new mem comparison.