add tests for #2
simpler tests for #2
fix intersection detection, closes #2
clean up example a little bit