working triangulation
working code