Convereted methods to use update() rather than set things on their own. Also added init() method.