This and the next 2 statements will not necessarily guarantee that the new values are different than the old values, unless you set the old values back (as @AlinT suggested) to something that you know cannot be the same as these. If you have a known set of old and new values then you don't really need to randomize at all.