updated to take advantage of environment variables