Reformatting, basic optimization and vectorization of random number generator