a mask set of two masks and a method of using these masks in a double exposure to avoid line shortening due to optical proximity effects is described . a pattern having pattern elements comprising a number of line segments , wherein each of the line segments has one or two free ends which are not connected to other mask pattern elements is to be transferred to a layer of resist . a first mask is formed by adding line extensions to each of the free ends of the line segments . a cutting mask is formed comprising rectangles enclosing each of the line extensions wherein one of the sides of said rectangles is coincident with the corresponding free end of said line segment . the first mask has opaque regions corresponding to the extended line segments . the cutting mask has transparent regions corresponding to the cutting pattern . in another embodiment a pattern having pattern openings comprising a number of line segments . in this embodiment the cutting pattern comprises rectangles having the same width as said line segments and add length to the line segments .