fixed some bugs in utils and significantly re-worked triangulation.py