elements of this script work, but it isn't useful without major modification