Update the generate result method