took out insert functions and fixed update function