removed os dependency/environment variables

I removed the dependency on `os` and the environment variables. Although the previous way is technically better, this makes a little more sense, plus removes some code.