Heh.  No idea what that was
Use Tee intead of two passes to read through to file
Set up the environment in a single append
Use AfterFunc to run after a specific time duration