"len" is a built in function, so we shouldn't use it as a local variable name.  Use "L" or something else.