optimized and commented script.  Updated README.