Changed paste staff function to take a segment as a parameter