I'd have to say this script should require some needed attention...by the look of it, it's got a good chance of failure.