fixing triangulation bug