finished triagle counting