moved more code to Table.cpp