fixed trianglecounting