Code amended to correct for complete cases.