Added update method, fixes #1