factor retrieving dates from yahoo out of the example and into a library function, and save some PNGs in the man/figures folder