add a segment function for testing