fix: updated doctest, pep8 and unit test