Guard against divide-by-zero errors. Will need to contemplate whether this is the right thing.
Added functionality to add tables.
Update functionality.