Added another function to further condense code; found weird flaw in the replace in identify treatment tables that existed in original code, analyzing problem