Added Env variables and some minor functionality