Writing to environment