added table creation before input