Added documentation and renamed some functions for clarity
Called srand(time(null));