added automatic table creation