fix the intersection bug and add some linear algebra functions to helper.py