Ported to use enviornment variables and relative pathways.