implement Environment merging