Updated kernels for calculating triangles in the mesh