add doctests for edge cases