get_names_from_fileRefactored to work better without GNRD