add segment task implementation