Implemented poly to triangular

Implemented the poly to triangular. Want to close this branch. Merge it
and work on on another one then.