Modified to support PATH enviorment variable