ENH : made changes to doc/length calculation
TST : added more tests