Corrected the intersection code. It appears to be fully functional now. However it's quite hideous. It really needs to be refactored and hopefully have more of it generalized.