working penv script