rotation before flattening works