finished code to create tables. Added code to index attributes