Detecting the path variable

First priority - Take the path provided
Fallback to extract from $PATH. Takes first occurrence in the order of $PATH
I understand why you want to monkeypatch, I don't understand how it becomes an argument to this method.