move comments to the code.
complete doctests