testing the updating function