Added functionality of triangulation.