Modified to use the new function to download bars.