added doctest to main()