adding code to create data tables on fly