implemented match and update method