finished implementation of new update function, testing necessary