sort segments by start time rather than creation time
refactor post code