added segments method

Needed a segments method to return all segments in an array