added intersection point function
added unit tests