added random generate.cc