updated insert function for inclusion within read_file()