changed so the halve functions returns the length of the first value.