Converted to be runnable as user,not root. Added env variable based configuration