Doctest and changes according to python conventions