Added cost function for ellipse contacts