flattening scope