Drafted create_sf_file(), not tested