Updated doc.
Changed program to return a timeseries.
added functional test and unittest.