Fixed code so it'll run on Windows

I had to disable srand(time(NULL)) as it does not compile properly.