flattening working