Added mergeEnvironment