added a few corrections to the script.