got angle heuristic working and added a bunch of helper functions to the test suite.