Added folder structure when creating tables

Also corrected the indexing option