test function updated