Fix minor bugs in matchTriangle, add angle calculations