Fixed some bugs and moved the isWithinTriangle method to Utilities so it can be used again