preventing degenerated triangles