Fixed normalization function
Fixed this version to perform three segmentations, each with an output file