output is always three, im assuming this is because nameLength is being assigned to the last element of the array with consists of length 3.