Added update method and some extra functionality