The previous code just assumed a tab was 4 spaces wide. This is not true, because a tab can be between 1 and 4 spaces wide.