fixed triangluation and calc of min max