added segment slice function
cleanup
added line segment slice example