Fix random number generation

Conflicts:
	main.c
Change spaces to tabs