change rand(1)  to  rand(2)