new generate random data algorithm