Updated to catch where the series is just 1 number long.
Also checks length of longest series when exiting the loop