Included functinos to remove the term layer from the input file