scrip for the function envSample