Added make_tmp_dir function