tried to mess with jquery stuff
added some of the logic for modifying the table