little modification of random generator
addition of some new functions