Moved new variable detection routine higher, made so tables can be converted from a table.