Updates logic for the results and moves variables into object.