changed receive function to return segment