Change random func in serial version as well.