My flame thrower is thoroughly holstered because to be honest, I don't see anything flamable with your code. The only thing I might say is that it would make a better UDF, than a stand-alone section of code. In fact, this looks as if it was/is a UDF ... if this is the case, the only thing I might critique is the fact that UDF's shouldn't pump-out console messages (for a couple of reasons) unless maybe this "feature" was parameterized.

Is this the kind of feedback you were looking for ?

-Shawn