* fixed some bugs and changed API in Intersection calculation