Download function.