Construction Script Question

make adding a segemnt a function, and then call that function when you need to add a segment