add and update fully work, but could be better; straightened up variable names; revised TODO