Added counter to random seed

Added a counter to force the seed to change each time srand is used,
since srand uses the current second to generate the initial seed,
therefore operations using srand during the same second would generate
the same seed. That issue is fixed!