Update RECommonFunctions.m