Tested update method. Fixed errors.