added automatic table creation and alteration