Thank you for your detailed feedback, I certainly learned a lot about how not to implement random generation!