Updated to use #include <random> instead of rand()