setenv script to configure environment
lots of changes... too lazy to describe :)