I assume you're changing the amount reduced each time around the loop so you can get as close to 1000 as possible? Hmm, there should be a nicer way to do this calculation. Maybe not today though.

Why not move `if (rad...` outside the loop?