Updated CreateTable to properly use ID's and create child elements