Added variance computation for each segment