refactored the angle check out of the connectedlines function