segmented coding working