implement simple download function