flattening technique