doc length cal
more cleanup