minisize download function code