first very dirty and unstable version of random generator