Using rand() function instead of random() for all platforms including windows.