Add find x intersect and generalised input to ex5.cpp