Updated code, cleaned a little bit.  Different intersections now giving the correct answer.