added code to distinguish between string (path to series) and series object arguments