Contour calculation -> foillogic