Added update method and unit tests