source code of the length problem