Code Retyding. Bug in generating random numbers fixed.