Added function to create tables