Added a seed depending on current time for the pseudo-random number generator.