Wrote up the code for a bunch of intersection functions

these functions are not used anywhere, so it is ok for now, but they will require some review/testing