Tweak creation of tables. Add code for semantic distance.