this program has not been tested and may have bugs in segmenting procedure and colortables