Change random number gen to ran.h and other changes to compile in linux