> double TempRandZ = EnemyLowerBounds.y +
I'm guessing you meant EnemyLowerBounds.z ?

Create some small utility functions which you can then declare as inline if you need to later on.
The clue...