Updated .js file to insert table into DOM