wrote a first pass at line intersection, and cleaned up a few other bugs