adds environment, presumably much of this should be removed at some point