Add length in logic problem