Added downloadSource function