create generateMaxValue method