trying to add random generation. generation works, but i'm having trouble and crashes with the random part