Sorted usings
Operate on output from PS
Added check for env var