Fixed the intersection point bug. Added more test cases for boundaries. Refactored getting corners of devices