Added downloadSource function to main program