Added update function(not flexible)