pulled getSeries function into a stand alone JS file