added doctests
added coverage