Triangulation engine

code issues fixes