modified %RNDM replacement to allow usage of % as terminator