Combined all the supporting functions in a single helper function.
Given a segment number, getting the data