Did a lot of cleanup on the intersection logic to make it more understandable