added comments to code, minor change to ignore hydrogens, and cleaned up script