Now uses c++11 random. Doesn't crash :)