closed and max pattern v2.0