corect the TRandom problem & add the test alg